package org.dy.db.support;

public class CacheManager {

	private static BaseCache cache;

	private static CacheManager instance;

	private static Object lock = new Object();
	
	private CacheManager(int refreshPeriod) {
		cache = new BaseCache(refreshPeriod);
	}

	public static CacheManager getInstance(int refreshPeriod) {
		if (instance == null) {
			synchronized (lock) {
				if (instance == null) {
					instance = new CacheManager(refreshPeriod);
				}
			}
		}
		return instance;
	}

	public BaseCache getCache() {
		return cache;
	}

}